Optimal. Leaf size=272 \[ \frac {a^3 d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac {d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} \left (a^3+a^3 \csc (e+f x)\right )}{f (1-n)}+\frac {a^3 d^3 (5-4 n) \cos (e+f x) (d \csc (e+f x))^{-3+n} \, _2F_1\left (\frac {1}{2},\frac {3-n}{2};\frac {5-n}{2};\sin ^2(e+f x)\right )}{f (1-n) (3-n) \sqrt {\cos ^2(e+f x)}}+\frac {a^3 d^4 (11-4 n) \cos (e+f x) (d \csc (e+f x))^{-4+n} \, _2F_1\left (\frac {1}{2},\frac {4-n}{2};\frac {6-n}{2};\sin ^2(e+f x)\right )}{f (2-n) (4-n) \sqrt {\cos ^2(e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.32, antiderivative size = 272, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3317, 3899,
4082, 3872, 3857, 2722} \begin {gather*} \frac {a^3 d^4 (11-4 n) \cos (e+f x) (d \csc (e+f x))^{n-4} \, _2F_1\left (\frac {1}{2},\frac {4-n}{2};\frac {6-n}{2};\sin ^2(e+f x)\right )}{f (2-n) (4-n) \sqrt {\cos ^2(e+f x)}}+\frac {a^3 d^3 (5-4 n) \cos (e+f x) (d \csc (e+f x))^{n-3} \, _2F_1\left (\frac {1}{2},\frac {3-n}{2};\frac {5-n}{2};\sin ^2(e+f x)\right )}{f (1-n) (3-n) \sqrt {\cos ^2(e+f x)}}+\frac {a^3 d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{n-3}}{f (1-n) (2-n)}+\frac {d^3 \cot (e+f x) \left (a^3 \csc (e+f x)+a^3\right ) (d \csc (e+f x))^{n-3}}{f (1-n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 3317
Rule 3857
Rule 3872
Rule 3899
Rule 4082
Rubi steps
\begin {align*} \int (d \csc (e+f x))^n (a+a \sin (e+f x))^3 \, dx &=d^3 \int (d \csc (e+f x))^{-3+n} (a+a \csc (e+f x))^3 \, dx\\ &=\frac {d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} \left (a^3+a^3 \csc (e+f x)\right )}{f (1-n)}-\frac {\left (a d^3\right ) \int (d \csc (e+f x))^{-3+n} (a+a \csc (e+f x)) (a (2+2 (-3+n))+a (5+2 (-3+n)) \csc (e+f x)) \, dx}{1-n}\\ &=\frac {a^3 d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac {d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} \left (a^3+a^3 \csc (e+f x)\right )}{f (1-n)}+\frac {\left (a d^3\right ) \int (d \csc (e+f x))^{-3+n} \left (a^2 (11-4 n) (1-n)+a^2 (5-4 n) (2-n) \csc (e+f x)\right ) \, dx}{2-3 n+n^2}\\ &=\frac {a^3 d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac {d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} \left (a^3+a^3 \csc (e+f x)\right )}{f (1-n)}+\frac {\left (a^3 d^2 (5-4 n)\right ) \int (d \csc (e+f x))^{-2+n} \, dx}{1-n}+\frac {\left (a^3 d^3 (11-4 n)\right ) \int (d \csc (e+f x))^{-3+n} \, dx}{2-n}\\ &=\frac {a^3 d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac {d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} \left (a^3+a^3 \csc (e+f x)\right )}{f (1-n)}+\frac {\left (a^3 d^2 (5-4 n) (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{2-n} \, dx}{1-n}+\frac {\left (a^3 d^3 (11-4 n) (d \csc (e+f x))^n \left (\frac {\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac {\sin (e+f x)}{d}\right )^{3-n} \, dx}{2-n}\\ &=\frac {a^3 d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac {d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} \left (a^3+a^3 \csc (e+f x)\right )}{f (1-n)}+\frac {a^3 (5-4 n) \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {3-n}{2};\frac {5-n}{2};\sin ^2(e+f x)\right ) \sin ^3(e+f x)}{f (1-n) (3-n) \sqrt {\cos ^2(e+f x)}}+\frac {a^3 (11-4 n) \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac {1}{2},\frac {4-n}{2};\frac {6-n}{2};\sin ^2(e+f x)\right ) \sin ^4(e+f x)}{f (2-n) (4-n) \sqrt {\cos ^2(e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 5 in
optimal.
time = 24.93, size = 28213, normalized size = 103.72 \begin {gather*} \text {Result too large to show} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.52, size = 0, normalized size = 0.00 \[\int \left (d \csc \left (f x +e \right )\right )^{n} \left (a +a \sin \left (f x +e \right )\right )^{3}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int \left (d \csc {\left (e + f x \right )}\right )^{n}\, dx + \int 3 \left (d \csc {\left (e + f x \right )}\right )^{n} \sin {\left (e + f x \right )}\, dx + \int 3 \left (d \csc {\left (e + f x \right )}\right )^{n} \sin ^{2}{\left (e + f x \right )}\, dx + \int \left (d \csc {\left (e + f x \right )}\right )^{n} \sin ^{3}{\left (e + f x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (\frac {d}{\sin \left (e+f\,x\right )}\right )}^n\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^3 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________